﻿namespace _10._2
{
    public class Myclass
    {
        private int state = 1;
        public int State => this.state;

        public class ClassB
        {
            public void SetPrivateState(Myclass m1,int newState)
            {
                m1.state = newState;
            }
        }
    }
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            Myclass m1 = new Myclass();
            Console.WriteLine($"m1.State={m1.State}");
            Myclass.ClassB m1b=new Myclass.ClassB();
            m1b.SetPrivateState(m1,2);
            Console.WriteLine($"m1.State={m1.State}");

        }
    }
}
